package main

import "fmt"

/**
接口
*/
//定义接口
type People interface {
	sayHello()
}
type Tester interface {
	test()
	toDoString() string
	isUser(name string) //具有参数的方法
	People
}
//定义结构体
type Student struct {
	name string
}
//实现接口
func (stu Student) test() {
	fmt.Println(stu.name + " is Test...")
}
//实现接口
func (stu Student) toDoString() string{
	fmt.Println(stu.name + " is ToString...")
	return stu.name
}
func (stu Student) sayHello() {
	fmt.Println("Hello")
}
func (stu Student) isUser(name string) {
	fmt.Println("He is "+name)
}
func main() {
	stu := Student{name: "xm"}
	stu.test()
	println(stu.toDoString())
	stu.isUser(stu.name)
	stu.sayHello()
}
